package cc.dowell.enums;

public enum HttpCodeEnum {
    // 通用：成功与失败
    SUCCESS(200, "操作成功"),
    FAIL(400, "操作失败"),
    //消息定义
    ADD_SUCCESS(201,"保存成功"),
    ADD_FAIL(301,"保存失败"),
    UPDATE_SUCCESS(202,"修改成功"),
    UPDATE_FAIl(302, "修改失败"),
    DELETE_SUCCESS(203,"删除成功"),
    DELETE_FAIl(303, "删除失败"),
    WRONG_OLD_PWD(304, "错误的旧密码"),
    // 园区
    NEED_LOGIN(401, "需要登录后操作"),
    FARM_IS_BLANK(401,"农场名为空"),
    UPLOAD_FAIL(402,"图片上传失败"),
    NOT_SELF_ZONE(403,"请删除自己的园区"),
    NOT_HAVA_ZONE(405,"没有该园区"),
    ZONE_IS_BLANK(406,"编辑园区为空"),
    //检测
    DETECT_FINISH(501,"本次检测结果已保存至历史记录"),
    DETECT_EXCEPTION(502,"异常检测结果无法保存"),
    DETECT_FAIL(503,"检测结果保存失败")
    ;

    int code;
    String msg;

    HttpCodeEnum(int code, String errorMessage) {
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
